import { IsNotEmpty } from 'class-validator';
import { IsNotExists } from 'src/common/rules/is-exists';

export class RegisterDto {
  @IsNotEmpty({ message: '登录名称不能为空' })
  @IsNotExists('user', { message: '姓名已经存在' })
  name: string;

  @IsNotEmpty({ message: '邮箱不能为空' })
  @IsNotExists('user', { message: '邮箱已经存在' })
  email: string;

  @IsNotEmpty({ message: '密码不能为空' })
  password: string;
}
